package lyj.springcloud.controller;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

/**
 * 消息消费者
 */
@EnableBinding(Sink.class) //// 定义消息的消费管道channel
@Component
public class RecvMessageListenerController {


    @StreamListener(Sink.INPUT)
    public void input(Message message) {
        System.out.println(" 消费者接收到的消息：" + message.getPayload());
    }
}
